package com.cc.visitor.dao;

import com.cc.visitor.entity.UserWeixin;
import com.mybatisflex.core.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author chanchaw
 * @create 2024-09-17 17:06
 */
@Repository
public interface UserWeixinMapper extends BaseMapper<UserWeixin> {
    @Select("select * from user_weixin where open_id=#{openId};")
    UserWeixin get8OpenId(@Param("openId") String openId);
    @Select("select * from user_weixin where union_id=#{unionId};")
    UserWeixin get8UnionId(@Param("unionId") String unionId);
    @Select("select * from user_weixin where mini_id=#{miniId};")
    UserWeixin get8MiniId(@Param("miniId") String miniId);
    @Select("select * from user_weixin where real_name='${name}';")
    List<UserWeixin> get8RealName(@Param("name") String name);
    // 获取所有访客资料，用于管理后台修改访客数据
    @Select("call usp_getAllVisitor()")
    List<UserWeixin> getAllVisitor();
    @Select("call usp_getDevs()")// 获取所有开发人员
    List<UserWeixin> getDevs();
}
